
package nav;

public class LinkTopologyObjectImpl implements ITopologyObject{

	private int id;
	private int from;
	private int to;
	
	private StreetTopologyObjectImpl street;
	private int numberOnStreetLineString;
	private double length;
	
    public LinkTopologyObjectImpl(int id, int from, int to,double length) {
    	this.id=id;
    	this.from = from;
    	this.to=to;
    	this.length=length;
    
    	
    
    }
    
    public StreetTopologyObjectImpl getStreet(){
    	return street;
    }
    public void setStreet(ITopologyObject street, int pointNr){
    	
    	this.street = (StreetTopologyObjectImpl)street;
    	this.numberOnStreetLineString = pointNr;

    }
    
    public void setPointNr(int n){
    	this.numberOnStreetLineString=n;
    }
    
    
    public int crossingFrom(){
    	return from;
    }
    
    public int crossingTo(){
    	return to;
    }
    
    public double length(){
    	return length;
    }
    
    public void setLength(double length){
    	this.length = length;
    }
    
    public Object read(String source) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String write() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

	public int getID() {
		// TODO Auto-generated method stub
		return id;
	}
	
	public int getPointNr(){
		return numberOnStreetLineString;
	}
	@Override
	public String toString(){
		String r = "ID: " + id +", From: "+ from + " To: "+ to+ " Length: "+ length + "Street: "+ street + "PointNr: "+ numberOnStreetLineString+"!!!\n";
		return r;
	}
}
